#include "BasicIncludes.h"

struct gameStateFunctions{
	const char* name;
	const char* loopFunc;
	const char* loadFunc;
	const char* mouseButtonDownFunc;
	const char* mouseButtonReleasedFunc;
	const char* keyboardKeyDownFunc;
	const char* keyboardKeyReleasedFunc;
};

static char* currentState = TEXT("");

typedef map<const char*, gameStateFunctions> stateMap;
static stateMap States;

static list<char*> pressedKeys;

//Lua_functions
int addState(lua_State* L);
int registerLoadFunc(lua_State* L);
int registerLoopFunc(lua_State* L);

int registerMouseButtonDownFunc(lua_State* L);
int registerMouseButtonReleasedFunc(lua_State* L);

int registerKeyboardKeyDownFunc(lua_State* L);
int registerKeyboardKeyReleasedFunc(lua_State* L);

int setActiveState(lua_State* L);

//c++ functions
void callLoopFunction(lua_State* L);
void callKeyDownFunction(lua_State* L, char* key);
void callKeyReleasedFunction(lua_State* L, char* key);



